No default window or rendering context is supplied to an application. The client is responsible for creating them.
Each thread can have at most one current rendering context. In addition, a rendering context can be current for only one thread at one time.
Issuing OpenGL commands may cause the X buffer to be flushed. In particular, calling glFlush() will flush both the X and OpenGL rendering streams.
Some state is shared between the OpenGL and X. The pixel values in the X frame buffer are shared. The X multi-buffering extension has a definition for which buffer is currently the displayed buffer. This information is shared with GLX. The state of which buffer is displayed tracks in both extensions, independent of which extension initiates a buffer swap. (Multi-buffering and OpenGL double buffering share state only in the case where there are exactly two buffers.)